ioemu: Fix L1 table endianess of qcow images created by tapdisk
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 26 Mar 2008 14:44:21 +0000 (14:44 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 26 Mar 2008 14:44:21 +0000 (14:44 +0000)
commit71331acb085c1304be96d3f58313b518abbbbda2
tree6bef4fa438b1ee24430183b8f454f8bf2f9f8c02
parent8d4aef298fd6cf4fd4c9ef40f7797f62c7bab896
ioemu: Fix L1 table endianess of qcow images created by tapdisk

The qemu/ioemu implementation of the qcow format uses a big endian L1
table. tapdisk omits the necessary conversion, so qcow images have the
wrong endianess and cannot be read by correct implementations of qcow.

This patch detects broken tapdisk images and converts their L1 tables
to big endian when the image file is opened in ioemu for the first
time. The fixed image has a new flag EXTHDR_L1_BIG_ENDIAN set in the
extended header.

Note that a converted image cannot be opened by tapdisk again.

Signed-off-by: Kevin Wolf <kwolf@suse.de>
tools/ioemu/block-qcow.c